package com.atguigu.edu.realtime.publisher.controller;

import com.atguigu.edu.realtime.publisher.bean.CourseReviewCnt;
import com.atguigu.edu.realtime.publisher.service.CourseReviewCountService;
import com.atguigu.edu.realtime.publisher.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CourseReviewCountController {
    @Autowired
    CourseReviewCountService courseReviewCountService;
    @RequestMapping("/revuser")
    public String getRevUserCnt(@RequestParam(value = "date", defaultValue = "1") Integer date){
        if(date == 1){
            date = DateUtil.now();
        }
        List<CourseReviewCnt> revUserCnt = courseReviewCountService.getRevUserCnt(date);
        return "";
    }
}
